home *** CD-ROM | disk | FTP | other *** search
- property deltaV, deltaH, deltaZ, mysprite, myCast, myFrame, myScale, theCharmed, theWidth, theHeight
-
- on birth me, listposition, startChannel
- set mylistposition to listposition
- set mysprite to mylistposition + startChannel
- set myFrame to 0
- set deltaV to random(9) - 5
- set deltaH to random(9) - 5
- set deltaZ to random(3) - 2
- if deltaZ <> 0 then
- set myScale to random(3) + 1
- else
- set myScale to 1
- end if
- set theHeight to the height of cast "A1"
- set theWidth to the width of cast "A1"
- set myCast to the number of cast "A1" + ((random(6) - 1) * 7) + 1
- set the castNum of sprite mysprite to myCast
- set myFrame to myCast
- set the locV of sprite mysprite to random(344) + 40
- set the locH of sprite mysprite to random(260) + 40
- set the height of sprite mysprite to theHeight / myScale
- set the width of sprite mysprite to theWidth / myScale
- return me
- end
-
- on animateFlake me
- set myFrame to myFrame + 1
- if myFrame = (myCast + 6) then
- set myFrame to myCast
- end if
- set the castNum of sprite mysprite to myFrame
- if theCharmed = 1 then
- if (the mouseH < the locH of sprite mysprite) and (deltaH > -4) then
- set deltaH to deltaH - 1
- else
- if (the mouseH > the locH of sprite mysprite) and (deltaH < 4) then
- set deltaH to deltaH + 1
- end if
- end if
- if (the mouseV < the locV of sprite mysprite) and (deltaV > -4) then
- set deltaV to deltaV - 1
- else
- if (the mouseV > the locV of sprite mysprite) and (deltaV < 4) then
- set deltaV to deltaV + 1
- end if
- end if
- if (abs(the mouseH - the locH of sprite mysprite) < 20) and (abs(the mouseV - the locV of sprite mysprite) < 20) then
- puppetSound("CharmOff")
- set theCharmed to 0
- set deltaV to -deltaV
- set deltaH to -deltaH
- end if
- end if
- if theCharmed = 0 then
- if random(250) = 1 then
- set deltaV to random(9) - 5
- end if
- if random(250) = 1 then
- set deltaH to random(9) - 5
- end if
- end if
- set currentVPOS to the locV of sprite mysprite + deltaV
- set currentHPOS to the locH of sprite mysprite + deltaH
- if currentVPOS < 50 then
- set currentVPOS to 50
- set deltaV to 5
- end if
- if currentHPOS < 50 then
- set currentHPOS to 50
- set deltaH to 5
- end if
- if (currentVPOS > 200) and (currentHPOS > 300) then
- set currentVPOS to 200
- set deltaV to -5
- else
- if currentVPOS > 400 then
- set currentVPOS to 400
- set deltaV to -5
- end if
- end if
- if (currentHPOS > 300) and (currentVPOS > 200) then
- set currentHPOS to 300
- set deltaH to -5
- else
- if currentHPOS > 400 then
- set currentHPOS to 400
- set deltaH to -5
- end if
- end if
- set the locV of sprite mysprite to currentVPOS
- set the locH of sprite mysprite to currentHPOS
- if deltaZ = -1 then
- if myScale = 4 then
- set deltaZ to random(2) - 1
- else
- set myScale to myScale + 1
- set the height of sprite mysprite to theHeight / myScale
- set the width of sprite mysprite to theWidth / myScale
- end if
- else
- if deltaZ = 1 then
- if myScale = 1 then
- set deltaZ to random(2) - 2
- else
- set myScale to myScale - 1
- set the height of sprite mysprite to theHeight / myScale
- set the width of sprite mysprite to theWidth / myScale
- end if
- else
- set deltaZ to random(3) - 2
- end if
- end if
- end
-
- on swapFlake me
- set currentVPOS to the locV of sprite mysprite
- set currentHPOS to the locH of sprite mysprite
- set myCast to the number of cast "A1" + ((random(6) - 1) * 7) + 1
- set the castNum of sprite mysprite to myCast
- set myFrame to myCast
- set the locV of sprite mysprite to currentVPOS
- set the locH of sprite mysprite to currentHPOS
- end
-
- on dragFlake me
- set currentVPOS to the mouseV
- set currentHPOS to the mouseH
- set the locV of sprite mysprite to currentVPOS
- set the locH of sprite mysprite to currentHPOS
- swapFlake(me)
- updateStage()
- end
-
- on charmFlake me
- set theCharmed to 1
- end
-
- on toggleCharm me
- if theCharmed = 1 then
- puppetSound("CharmOff")
- set theCharmed to 0
- else
- puppetSound("CharmOn")
- set theCharmed to 1
- end if
- end
-